package com.ncepu.clubmanagement.pojo;

import com.ncepu.clubmanagement.pojo.inter.ClubAddAssist;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class ClubAdd {
    private String clubName;
    private String introduction;
    private Integer clubLevel;
    private Integer personId;  // 用户id,表示管理员


    public Club toClub(ClubAddAssist clubAddAssist){   // 适配器方法,将ClubAdd转换为Club
        String clubName = this.clubName;
        String introduction = this.introduction;
        Integer number = 1;
        Integer clubState = 0;
        String backImage = null;
        Integer clubLevel = this.clubLevel;
        Integer schId = clubAddAssist.personIdToSchId();

        Club club = new Club(null,clubName,introduction,number,
                clubState,backImage,clubLevel,schId);

        return club;

    }
}
